package cn.bonoon.services.plugins;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.bonoon.core.plugins.FaqService;
import cn.bonoon.entities.plugins.FaqEntity;
import cn.bonoon.kernel.support.IOperator;
import cn.bonoon.kernel.support.services.AbstractService;

@Service
@Transactional(readOnly = true)
public class FaqServiceImpl extends AbstractService<FaqEntity> implements FaqService {
//
//	@Override
//	public List<FaqEntity> faqs(IOperator opt) {
//		return __list(domainClass, "select x from FaqEntity x where x.creatorId=?", opt.getId());
//	}

	@Override
	public List<FaqEntity> faqs(String key, IOperator opt) {
		return __list(domainClass, "select x from FaqEntity x where x.ownerId=? and x.key=?", opt.getOwnerId(), key);
	}
}
